﻿
using System;
using UnityEngine;

//目标点
public class Purpose
{
    public Vector3 TargetPos;//目标点位置
    public float StopDistance;//停止距离
    public Action Callback;//触发的事件
    public virtual void Init(Creature target, float stopDis, Action callback)
    {
        //目前，仅给子类来用
    }
    public virtual void Loop()
    {

    }
}
//追踪性的目标
public class PurposeTrace : Purpose 
{
    public Creature Target;//追踪目标
    public Creature Owner;
    public override void Init(Creature target,float stopDis,Action callback)
    {
        Target = target;
        StopDistance = stopDis;
        Callback = callback;

        TargetPos = Target.Position;
    }
    public override void Loop()
    {
        //需要update，做出反应B
        TargetPos = Target.Position;
        Owner.PathTo(Target.Position);
    }

}

